#!/usr/bin/node
//server
const log = console.log;

const http = require('http');

http.createServer((req,res)=>{
  log(`${req.method} ${req.url} HTTP/${req.httpVersion}`);
  //request header
  log(req.headers);
  //request body
  req.pipe(process.stdout);

  res.end('ok');

}).listen(8080);
